package com.gr.staffpm.security.dao;

import java.util.List;

import com.gr.staffpm.datatypes.Group;
import com.gr.staffpm.datatypes.Permission;
import com.gr.staffpm.datatypes.Role;
import com.gr.staffpm.datatypes.User;

/**
 * Data Access Object for User related operations.
 */
public interface UserDAO {

    User getUser(int userId);

    User findUser(String username);

    void createUser(User user);

    List<User> getAllUsers();

    void deleteUser(int userId);

    void addOrUpdateUser(User user);

    List<User> getAllUsers(String property, boolean ascending);

    List<User> getUsersInGroupByGroupName(String groupName, User currUser, int userLevel);

    Role getUserRole();

    void addRole(User user, String roleName);

    List<Role> getAllRoles();

    void addRoles(User user, List<Role> roles);

    List<Group> getAllGroups();

    boolean checkUserExists(User user);

    List<Role> getAllRoles(String property, boolean ascending);

    Role getRole(int id);

    List<Permission> getAllPermissions();

    void createOrUpdateRole(Role newRole);

    void createPermission(Permission permission, Role role);

    void deletePermission(String permissionString);

}
